package com.lggry.demo;

public class SilverCard extends Card{

    public SilverCard(String cardId, String name, String phone, int money) {
        super(cardId, name, phone, money);
    }

    @Override
    public void consume(double money) {
        System.out.println("您当前消费：" + money);
        System.out.println("优惠后的价格：" + money * 0.9);

        if(getMoney() < money * 0.9){
            System.out.println("您的账户余额不足，请充值");
            return;
        }
        //更新银卡的账户余额。
        setMoney(getMoney() - money * 0.9);
    }
}
